/*
 * Lab4Am.cpp
 *
 *  Created on: 2012-01-08
 *      Author: Anthony Varghese
 * Description: A simple program showing how to use C++ string objects
 *              and functions
 */
#include <iostream>
#include <string>

using namespace std;

int countwords() {
	int count = 0;
	string s;
	do {
		cin >> s;


	} while ( ); // error - you need a condition here
	return count;
}

findlongest(){ // error - you need a return type
	int count = 0;
	string s;
	do {
		cin >> s;


	} while ( ); // error - you need a condition here

	return ; // error - need to return something
}

int count_whitespace(){

	return 0;
}


int main(){
	cout << "Countwords" << endl;
	cout << "Enter strings\n  (I'll stop when I see a q by itself): ";
	int number_of_words = countwords();
	cout << "  You entered " << number_of_words << " words." << endl;

	cout << "Enter strings\n  (I'll stop when I see a q by itself): ";
	string longest = findlongest();
	cout << "   Longest string you entered was " << longest << endl;

	cout << endl << endl << "Part III" << endl;
	// Using console input (the keyboard)
	cout << "Enter a string> ";
	string b;
	cin >> b;
	cout << "You entered: " << b << endl;

	cout << "Enter a line of text> ";
	getline( cin, b);
	cout << "You entered: " << b << endl;
	cout << "   and it has " << count_whitespace() << endl;
}
